Crate pgx_macros[][src]

Macros

Embed SQL directly into the generated extension script.

Attribute Macros

Used with #[pg_operator]. 1 value which is the function name

Used with #[pg_operator]. no values

Associated macro for #[pg_test] to provide context back to your test framework to indicate that the test system is being initialized

Used with #[pg_operator]. 1 value which is the function name

Used with #[pg_operator]. no values

Used with #[pg_operator]. 1 value which is the function name

Used with #[pg_operator]. 1 value which is the operator name itself

Declare a function as #[pg_extern] to indicate that it can be used by Postgres as a UDF

Declare a function as #[pg_guard] to indcate that it is called from a Postgres extern "C" function so that Rust panic!()s (and Postgres elog(ERROR)s) will be properly handled by pgx

Declare a function as #[pg_operator] to indicate that it represents a Postgres operator cargo pgx schema will automatically generate the underlying SQL

#[pg_test] functions are test functions (akin to #[test]), but they run in-process inside Postgres during cargo pgx test.

Used with #[pg_operator]. 1 value which is the function name

Associated macro for #[pg_extern] or #[pg_operator]. Used to set the SEARCH_PATHoption on theCREATE FUNCTION` statement.

Derive Macros